import http from '@/utils/http'
import qs from 'qs'

// 获取当前用户的评价数
export const getEvaNum = () => {
	return http.get('p?service=nurseperson&operation=getbubblingnum');
}

// 获取省份
export const getProvinces = () => {
	return http.get(`g?service=doctorperson&operation=provincelist`)
}

// 获取城市
export const getCitys = (provinceid) => {
	return http.get(`g?service=doctorperson&operation=citylist&provinceid=${provinceid}`)
}

// 获取医院列表
export const getHospitals = (cityid) => {
	return http.get(`g?service=doctorperson&operation=hospitallist&cityid=${cityid}`)
}

// 获取一级科室
export const getDeptBig = () => {
	return http.get(`g?service=doctorperson&operation=bigdepartmentlist`)
}

// 获取二级科室
export const getDeptSmall = (id) => {
	return http.get(`g?service=doctorperson&operation=smalldepartmentlist&departmentid=${id}`)
}

// 获取职称列表
export const getJobTitle = () => {
	return http.get(`g?service=doctorperson&operation=jobtitlelist`)
}

// 保存个人资料
export const saveInfos = (params) => {
	return http.post(`p?service=nurseperson&operation=perfectinfo`, params)
}

// 保存用户头像
export const saveAvatar = (params) => {
	return http.post(`p?service=nurseperson&operation=headpic`, params)
}

// 我的认证
export const saveAuth = (params) => {
	return http.post(`p?service=nurseperson&operation=submitChaperonageInfo`, params)
}

// 获取认证信息
export const getAuth = () => {
	return http.get(`g?service=nurseperson&operation=nurseChaperonageInfo`)
}

// 获取用户的银行和支付宝信息
export const getBankAndAlipayInfo = () => {
	return http.get(`p?service=nurseperson&operation=bankAndAlipayInfo`)
}

// 保存银行s账户
export const saveBankInfo = (params) => {
	return http.get(`p?service=nurseperson&operation=updatebankinfo`, params)
}

// 保存支付宝账户
export const saveAlipayInfo = (params) => {
	return http.get(
		`p?service=nurseperson&operation=updatealipayinfo&alipayName=${params.alipayName}&alipayCardNumber=${params.alipayCardNumber}`,
		params)
}

// 删除支付宝账户
export const delAlipayInfo = () => {
	return http.post(`p?service=nurseperson&operation=deletealipay`)
}

// 删除银行账户
export const delBankInfo = () => {
	return http.get(`p?service=nurseperson&operation=deletebank`)
}

// 获取银行列表
export const getBankList = () => {
	return http.get(`g?service=doctorperson&operation=banklist`)
}